//
//  SXWYDetailPhotoView.m
//  ShiXun
//
//  Created by lanou on 15/10/30.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXWYDetailPhotoView.h"

@implementation SXWYDetailPhotoView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _imageScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 64, kScreenWidth, kScreenHeight - 104)];
        _imageScrollView.pagingEnabled = YES;
        _imageScrollView.showsHorizontalScrollIndicator = NO;
        [self addSubview:_imageScrollView];
        
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, kScreenHeight - 170, kScreenWidth - 90, 20)];
        _titleLabel.font = [UIFont systemFontOfSize:16];
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.textColor = [UIColor whiteColor];
        [self addSubview:_titleLabel];
        
        _countLabel = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 80, kScreenHeight - 170, 70, 20)];
        _countLabel.font = [UIFont systemFontOfSize:12];
        _countLabel.textColor = [UIColor whiteColor];
        _countLabel.textAlignment = NSTextAlignmentRight;
        [self addSubview:_countLabel];
        
        _contentScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(10, kScreenHeight - 150, kScreenWidth - 20, 110)];
        [self addSubview:_contentScrollView];
        _contentLabel = [[UILabel alloc] init];
        _contentLabel.font = [UIFont systemFontOfSize:13];
        _contentLabel.numberOfLines = 0;
        _contentLabel.textColor = [UIColor whiteColor];
        [_contentScrollView addSubview:_contentLabel];
    }
    return self;
}
+ (CGFloat)heightOfString:(NSString *)labelText
{
    CGRect bounds = [labelText boundingRectWithSize:CGSizeMake(kScreenWidth - 20, 0) options:NSStringDrawingUsesLineFragmentOrigin attributes:[NSDictionary dictionaryWithObject:[UIFont systemFontOfSize:13] forKey:NSFontAttributeName] context:nil];
    return bounds.size.height;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
